Stylesheet tweak for long credits section
[lhc/web/wiklou.git] / skins / disabled / HTMLDump.php
1 <?php
2
3 /**
4 * Default skin for HTML dumps, based on MonoBook.php
5 */
6
7 if( !defined( 'MEDIAWIKI' ) )
8 die();
9
10 /** */
11 require_once( 'includes/SkinTemplate.php' );
12
13 /**
14 * Inherit main code from SkinTemplate, set the CSS and template filter.
15 * @todo document
16 * @package MediaWiki
17 * @subpackage Skins
18 */
19 class SkinHTMLDump extends SkinTemplate {
20 /** Using monobook. */
21 function initPage( &$out ) {
22 SkinTemplate::initPage( $out );
23 $this->template = 'HTMLDumpTemplate';
24 }
25
26 function buildSidebar() {
27 $sections = parent::buildSidebar();
28 $badMessages = array( 'recentchanges-url', 'randompage-url' );
29 $badUrls = array();
30 foreach ( $badMessages as $msg ) {
31 $badUrls[] = $this->makeInternalOrExternalUrl( wfMsgForContent( $msg ) );
32 }
33
34 foreach ( $sections as $heading => $section ) {
35 foreach ( $section as $index => $link ) {
36 if ( in_array( $link['href'], $badUrls ) ) {
37 unset( $sections[$heading][$index] );
38 }
39 }
40 }
41 return $sections;
42 }
43
44 function buildContentActionUrls() {
45 $content_actions = array();
46 $nskey = $this->getNameSpaceKey();
47 $content_actions[$nskey] = $this->tabAction(
48 $this->mTitle->getSubjectPage(),
49 $nskey,
50 !$this->mTitle->isTalkPage() );
51
52 $content_actions['talk'] = $this->tabAction(
53 $this->mTitle->getTalkPage(),
54 'talk',
55 $this->mTitle->isTalkPage(),
56 '',
57 true);
58 return $content_actions;
59 }
60
61 function makeBrokenLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
62 if ( !isset( $nt ) ) {
63 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
64 }
65
66 if ( $nt->getNamespace() == NS_CATEGORY ) {
67 return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
68 }
69
70 if ( $text == '' ) {
71 $text = $nt->getPrefixedText();
72 }
73 return $prefix . $text . $trail;
74 }
75 }
76
77 /**
78 * @todo document
79 * @package MediaWiki
80 * @subpackage Skins
81 */
82 class HTMLDumpTemplate extends QuickTemplate {
83 /**
84 * Template filter callback for MonoBook skin.
85 * Takes an associative array of data set from a SkinTemplate-based
86 * class, and a wrapper for MediaWiki's localization database, and
87 * outputs a formatted page.
88 *
89 * @access private
90 */
91 function execute() {
92 $this->modifySetup();
93 $this->reallyExecute();
94 }
95
96
97 function modifySetup() {
98 /*
99 foreach ( $this->data['navigation_urls'] as $index => $link ) {
100 if ( $link['text'] == 'recentchanges' ) {
101 unset( $this->data['navigation_urls'][$index] );
102 } elseif ( $link['text'] */
103 }
104
105 function reallyExecute() {
106 wfSuppressWarnings();
107 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
108 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
109 <head>
110 <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
111 <?php $this->html('headlinks') ?>
112 <title><?php $this->text('pagetitle') ?></title>
113 <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/htmldump/main.css"; /*]]>*/</style>
114 <link rel="stylesheet" type="text/css" media="print" href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
115 <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
116 <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
117 <!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style><![endif]-->
118 <!--[if IE]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script>
119 <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
120 <?php if($this->data['jsvarurl' ]) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"></script><?php } ?>
121 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script>
122 </head>
123 <body
124 <?php if($this->data['nsclass' ]) { ?>class="<?php $this->text('nsclass') ?>"<?php } ?>>
125 <div id="globalWrapper">
126 <div id="column-content">
127 <div id="content">
128 <a name="top" id="contentTop"></a>
129 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
130 <h1 class="firstHeading"><?php $this->text('title') ?></h1>
131 <div id="bodyContent">
132 <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
133 <div id="contentSub"><?php $this->html('subtitle') ?></div>
134 <?php if($this->data['undelete']) { ?><div id="contentSub"><?php $this->html('undelete') ?></div><?php } ?>
135 <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
136 <!-- start content -->
137 <?php $this->html('bodytext') ?>
138 <?php if($this->data['catlinks']) { ?><div id="catlinks"><?php $this->html('catlinks') ?></div><?php } ?>
139 <!-- end content -->
140 <div class="visualClear"></div>
141 </div>
142 </div>
143 </div>
144 <div id="column-one">
145 <div id="p-cactions" class="portlet">
146 <h5>Views</h5>
147 <ul>
148 <?php foreach($this->data['content_actions'] as $key => $action) {
149 ?><li id="ca-<?php echo htmlspecialchars($key) ?>"
150 <?php if($action['class']) { ?>class="<?php echo htmlspecialchars($action['class']) ?>"<?php } ?>
151 ><a href="<?php echo htmlspecialchars($action['href']) ?>"><?php
152 echo htmlspecialchars($action['text']) ?></a></li><?php
153 } ?>
154 </ul>
155 </div>
156 <div class="portlet" id="p-logo">
157 <a style="background-image: url(<?php $this->text('logopath') ?>);"
158 href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"
159 title="<?php $this->msg('mainpage') ?>"></a>
160 </div>
161 <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
162 <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
163 <div class='portlet' id='p-<?php echo htmlspecialchars($bar) ?>'>
164 <h5><?php $this->msg( $bar ) ?></h5>
165 <div class='pBody'>
166 <ul>
167 <?php foreach($cont as $key => $val) { ?>
168 <li id="<?php echo htmlspecialchars($val['id']) ?>"><a href="<?php echo htmlspecialchars($val['href']) ?>"><?php echo htmlspecialchars($val['text'])?></a></li>
169 <?php } ?>
170 </ul>
171 </div>
172 </div>
173 <?php } ?>
174 <?php if( $this->data['language_urls'] ) { ?><div id="p-lang" class="portlet">
175 <h5><?php $this->msg('otherlanguages') ?></h5>
176 <div class="pBody">
177 <ul>
178 <?php foreach($this->data['language_urls'] as $langlink) { ?>
179 <li>
180 <a href="<?php echo htmlspecialchars($langlink['href'])
181 ?>"><?php echo $langlink['text'] ?></a>
182 </li>
183 <?php } ?>
184 </ul>
185 </div>
186 </div>
187 <?php } ?>
188 </div><!-- end of the left (by default at least) column -->
189 <div class="visualClear"></div>
190 <div id="footer">
191 <?php if($this->data['poweredbyico']) { ?><div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div><?php } ?>
192 <?php if($this->data['copyrightico']) { ?><div id="f-copyrightico"><?php $this->html('copyrightico') ?></div><?php } ?>
193 <ul id="f-list">
194 <?php if($this->data['lastmod' ]) { ?><li id="f-lastmod"><?php $this->html('lastmod') ?></li><?php } ?>
195 <?php if($this->data['numberofwatchingusers' ]) { ?><li id="f-numberofwatchingusers"><?php $this->html('numberofwatchingusers') ?></li><?php } ?>
196 <?php if($this->data['credits' ]) { ?><li id="f-credits"><?php $this->html('credits') ?></li><?php } ?>
197 <?php if($this->data['copyright' ]) { ?><li id="f-copyright"><?php $this->html('copyright') ?></li><?php } ?>
198 <?php if($this->data['about' ]) { ?><li id="f-about"><?php $this->html('about') ?></li><?php } ?>
199 <?php if($this->data['disclaimer']) { ?><li id="f-disclaimer"><?php $this->html('disclaimer') ?></li><?php } ?>
200 <?php if($this->data['tagline']) { ?><li id="f-tagline"><?php echo $this->data['tagline'] ?></li><?php } ?>
201 </ul>
202 </div>
203 </div>
204 <?php $this->html('reporttime') ?>
205 </body>
206 </html>
207 <?php
208 wfRestoreWarnings();
209 }
210 }
211 ?>